//
//  PopupViewController.m
//  PopUpDemo
//
//  Created by mac on 2025/9/6.
//
//  弹出ViewController

#import "PopupViewController.h"

@interface PopupViewController ()

@end

@implementation PopupViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do view setup here.
}

- (IBAction)okClick:(id)sender {
    
}

- (IBAction)cancelClick:(id)sender {
    [self.view.window close];
}

- (IBAction)exitClick:(id)sender {
    [NSApp terminate:self];
}

- (IBAction)okCodeClick:(id)sender {
    [NSApp stopModalWithCode:NSModalResponseOK];
    [self.view.window close];
}

- (IBAction)cancelCodeClick:(id)sender {
    [NSApp stopModalWithCode:NSModalResponseCancel];
    [self.view.window close];
}

- (IBAction)exitCodeClick:(id)sender {
    [NSApp terminate:self];
}


- (IBAction)okSheetClick:(id)sender {
    [self dismissViewController:self];
}

- (IBAction)cancelSheetClick:(id)sender {
    [self dismissViewController:self];
}

- (IBAction)exitSheetClick:(id)sender {
    [self dismissViewController:self];
    if (self.terminationHandler) {
        self.terminationHandler();
    }
}

@end
